package com.glsc.ngateway.platform.dto;

import com.glsc.ngateway.common.api.ldap.dto.LdapEhrDeptDto;
import com.glsc.ngateway.common.api.ldap.dto.LdapEhrEmpDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import java.text.Collator;
import java.util.Comparator;
import java.util.List;

/**
 * @author guoj
 * @description: 一级部门 及人员
 * @date 2024/7/19 11:23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
@ApiModel(value = "一级部门及人员")
public class DepartmentDto implements Comparator<DepartmentDto>  {
    @ApiModelProperty(value = "一级部门id")
    private  Integer depidOne;
    @ApiModelProperty(value = "一级部门名称")
    private String depOnename;
    @ApiModelProperty(value = "一级部门全部人员")
    private List<LdapEhrEmpDto> depOneAllUsers;


    @Override
    public int compare(DepartmentDto o1, DepartmentDto o2) {
        Comparator<Object> compare = Collator.getInstance(java.util.Locale.CHINA);
        return compare.compare(o1.getDepOnename(), o2.getDepOnename());
    }

}
